import store from "@/store";

export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 16,
};

export const formBase = [
  {
    label: "单号",
    type: "input",
    field: "courierNumber",
    required: true,
  },
  {
    label: "昵称",
    type: "input",
    field: "userName",
  },
  {
    label: "类型",
    type: "select",
    field: "type",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        label: "急件",
        value: 1,
      },
      {
        label: "拒签",
        value: 2,
      },
      {
        label: "先验视",
        value: 3,
      },
    ],
  },
  {
    label: "快递公司",
    type: "select",
    required: true,
    field: "companyId",
    optionsKey: "companyName",
    optionsValue: "id",
    options: store.state.custom_dict.company,
  },
  {
    label: "备注",
    type: "input",
    field: "remarks",
  },
];

export const tableBase = [
  {
    label: "单号",
    prop: "courierNumber",
    otherOptions: {},
    operate: {
      type: "input",
      field: "courierNumber",
      rules: /^[a-zA-Z0-9]{1,20}$/,
    },
  },
  {
    label: "类型",
    prop: "type",
    width: 150,
    operate: {
      type: "select",
      field: "type",
      optionsKey: "label",
      optionsValue: "value",
      options: [
        {
          label: "急件",
          value: 1,
        },
        {
          label: "拒签",
          value: 2,
        },
        {
          label: "先验视",
          value: 3,
        },
      ],
    },
  },
  {
    label: "会员昵称",
    prop: "userName",
    width: 150,
    operate: {
      type: "input",
      field: "userName",
    },
  },
  {
    label: "快递公司",
    prop: "companyName",
    width: 150,
    operate: {
      type: "select",
      field: "companyId",
      optionsKey: "companyName",
      optionsValue: "id",
      options: store.state.custom_dict.company,
      rules: /^[a-zA-Z0-9]{1,20}$/,
    },
  },
  {
    label: "备注",
    prop: "remarks",
    otherOptions: {},
    operate: {
      type: "input",
      field: "remarks",
    },
  },
  {
    label: "录入员工",
    prop: "entryEmployee",
    otherOptions: {},
    width: 150,
    operate: {
      type: "input",
      field: "entryEmployee",
    },
  },
  {
    label: "录入日期",
    prop: "entryTime",
    width: "150",
  },
];
